/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package util;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

/**
 * This class takes care of logging erros on the system.
 * The idea is to feed a text file with the erros contained
 * in the log ArrayList.
 * Make sure that every time that happens a exeption on the code
 * the function add() from this class is called.
 * @author gravena
 */
public class Logger {
    public static ArrayList<String> log = new ArrayList<String>();

    public static String getDate() {
        Calendar c = new GregorianCalendar();
        Date d = c.getTime();
        
        return d.toString();
    }

    public static void add(String message) {
        Logger.log.add(getDate() + " - " + message);
    }
}
